using System;
using PTP.Core;
using System.IO;

namespace PTP.Core
{
  /// <summary>
  /// IDeviceAdapter finds correct PTP device driver for given DeviceInfo.
  /// The adapter must identify camera without information from physical layer.
  /// </summary>
  public interface IDeviceAdapter
  {
    /// <summary>
    /// Test if this adapter can be used to create device for given DeviceInfo
    /// </summary>
    /// <param name="info">DeviceInfo returned by GetDeviceInfo command</param>
    /// <returns>true if this adapter is right for DeviceInfo; otherwise false</returns>
    bool IsValidForDevice(DeviceInfo info);

    /// <summary>
    /// Creates device using given stream
    /// </summary>
    /// <param name="s">PTP container stream</param>
    /// <returns>new device</returns>
    IPTPDevice CreateDevice(ContainerStream s);
  }
}
